//
//  MoreStoneViewController.m
//  Globalstone
//
//  Created by 辰领科技 on 16/7/18.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "MoreStoneViewController.h"
#import "SetupViewController.h"

@interface MoreStoneViewController ()
@property (strong, nonatomic) IBOutlet UIView *navView;
@property (strong, nonatomic) IBOutlet UIScrollView *scroview;
@property (weak, nonatomic) IBOutlet UIButton *phoneNum;

@end

@implementation MoreStoneViewController
- (void)viewWillAppear:(BOOL)animated{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initViewLayout];
    [self getConnectNum];
}
- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.navView];
    [self adaptiveViewLayout:self.scroview];
    _scroview.contentSize = flexibleSize(CGSizeMake(0, 505), NO);
    self.view.backgroundColor = [UIColor colorWithWhite:0.953 alpha:1.000];
}

- (IBAction)back:(id)sender {
    [self backBtn];
}

#pragma mark - 获取联系方式
- (void)getConnectNum{
    NSMutableDictionary  *dic=[NSMutableDictionary dictionary];
    self.shareApi.delegate=self;
    [self.shareApi  requestOperationWithDic:dic withPath:GS_contactInformation withHttpType:@"POST" withTag:GS_GS_contactInformation];

}

#pragma mark - 采购寻源
- (IBAction)source:(id)sender {
    UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"HomeStoryboard" bundle:nil];
    UIViewController * page = [storyBoard instantiateViewControllerWithIdentifier:@"Source"];
    [[Common getNavigation]pushViewController:page];
}
#pragma mark - 设置
- (IBAction)Setup:(id)sender {
    UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"HomeStoryboard" bundle:nil];
    SetupViewController * page = [storyBoard instantiateViewControllerWithIdentifier:@"Setup"];
//    page.pageFinishBlock = ^(){
//        [self backBtn];
//    };
    [[Common getNavigation]pushViewController:page];
}
#pragma mark - 联系方式
- (IBAction)contact:(id)sender {
    [Common callPhone:_phoneNum.titleLabel.text view:self.view];
}
#pragma mark - 确认
- (IBAction)confirmButton:(id)sender {
}


#pragma   mark---- GetADBanner Request Delegate

-(void)fetchDatabaseFinished:(NSMutableDictionary *)database withTag:(NSInteger)tag{
    
    if (tag==GS_GS_contactInformation) {
        
        if (  [[database valueForKey:@"flag"] integerValue]!=1 ) {
            
            [[CWHUDTips sharedInstance]  showTips:[database valueForKey:@"msg"]  withStatus:1 dismissAfter:1.5];
            
        }else  {
            [_phoneNum setTitle:[NSString stringWithFormat:@"%@",database[@"result"]] forState:UIControlStateNormal];
        }
        
    }
}
-(void)fetchDatabaseFailed:(NSError *)error message:(NSString *)message{
    [self dismissWaitDialog];
    
}


@end
